Project Overview :
● NumPy is an essential module for carrying out data science operations efficiently. NumPy stands for Numerical Python.
● Take the random values/numbers as a list/array and then find the median (midpoint valueafter you have sorted all the values in ascending order).
Synatax: np.mean()
Requirements :
● Python
● VS code
● Library – numpy
Code :
import numpy Speed = [99,86,87,88,111,86,103,87,94,78,77,85,86] x = numpy.median(Speed) print("MEDIAN OF THE LIST = ", x)
Code Explanation :
● import numpy -- import numpy as np and use it in python. In command prompt or VS code terminal run the below pip command to install numpy library,
● pip3 install numpy # For Python version 3
● Speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]
● Find the midpoint value from the list/array and stored in the variable x, then print it.
● x = numpy.median(Speed)
● print("MEDIAN OF THE LIST = ", x)
Output :
●After running the code, output of the terminal as given below,